// DialogInputNodeName.cpp : implementation file
//

#include "stdafx.h"
#include "map863.h"
#include "DialogInputNodeName.h"
#include "MapParameters.h"


// CDialogInputNodeName dialog

IMPLEMENT_DYNAMIC(CDialogInputNodeName, CDialog)

CDialogInputNodeName::CDialogInputNodeName(CWnd* pParent /*=NULL*/)
	: CDialog(CDialogInputNodeName::IDD, pParent)
{	
}

CDialogInputNodeName::~CDialogInputNodeName()
{
}

void CDialogInputNodeName::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_COMBO1, m_Combo);
}


BEGIN_MESSAGE_MAP(CDialogInputNodeName, CDialog)
END_MESSAGE_MAP()


// CDialogInputNodeName message handlers

void CDialogInputNodeName::OnOK()
{
	// TODO: Add your specialized code here and/or call the base class

	GetDlgItemText(IDC_COMBO1, m_NodeName, MAXNODENAMELENGTH);

	CDialog::OnOK();
}

BOOL CDialogInputNodeName::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here

//	char tempChar[MAXNODENAMELENGTH*2]={0};
	TCHAR tempWChar[MAXNODENAMELENGTH]={0};

	for (int i=1; i<=NodeCount; i++)
	{
		MultiByteToWideChar(CP_ACP, 0, NodeName[i], -1, tempWChar, MAXNODENAMELENGTH);
		m_Combo.AddString(tempWChar);
	}
	m_Combo.SetCurSel(0);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
